<template>
    <view class="uni-shadow u-p-t-10" @tap.stop="detail">
        <view class="u-font-28 font-bold">{{sceneItem.name}}</view>
        <u-row class="u-flex u-flex-wrap">
            <u-col v-for="(item,index) in sceneItem.list" :key="index" :span="(index+1)%2==0?5:7"
                class="u-m-t-20 u-flex u-font-26" style="flex-direction:row">
                <text class="uni-dec-color">{{item.title}}</text>
                <text class="u-m-l-20 u-line-1" style="max-width:55%">{{item.value}}</text> 
            </u-col>
        </u-row>
    </view>
</template>


<script>
export default {
    name:'sceneItem',
    props:{
        listItem:{
            type: Object,
            default(){
                return {}
            }
        }
    },

    data(){
        return{
            sceneItem: {
                name: '某某项目', // xmmc
                list:[
                    { filed:'districtName', title:'项目所属', value:'一师' },
                    { filed:'deviceType', title:'设备类型', value:'视频监控' },
                    { filed:'date', title:'安装时间', value:'2021-12-11' },
                    { filed:'deviceInstall', title:'设备状态', value:'已安装' },
                    // id 设备编号
                    // xmbh 项目编号
                ]
            }
        }
    },

    created() {
        this.sceneItem.name = this.listItem.xmmc
        this.sceneItem.list.map((v,i)=>{
            v.value = this.listItem[v.filed]
        })
    },

    methods: {
        detail(){
            uni.navigateTo({ url: '/pages/other-bag/equipment?id='+this.sceneItem.id })
        }
    },
}
</script>


<style scoped lang="scss">
</style>